//
// Created by Administrator on 24-8-26.
//

#ifndef RTOS_KEYSCAN_H
#define RTOS_KEYSCAN_H

#include "main.h"
#include "stm32f1xx_hal.h"
#include <string.h>





#define KEY_GPIO_PORT GPIOF
#define KEY_COL_PIN_0 GPIO_PIN_0
#define KEY_COL_PIN_1 GPIO_PIN_1
#define KEY_COL_PIN_2 GPIO_PIN_2
#define KEY_COL_PIN_3 GPIO_PIN_3

#define KEY_ROW_PIN_0 GPIO_PIN_4
#define KEY_ROW_PIN_1 GPIO_PIN_5
#define KEY_ROW_PIN_2 GPIO_PIN_6
#define KEY_ROW_PIN_3 GPIO_PIN_7

// 按键映射数组
static const uint8_t keyMap[4][4] = {
        {'1', '4', '7', '*'},
        {'2', '5', '8', '0'},
        {'3', '6', '9', '#'},
        {'A', 'B', 'C', 'D'}
};

void Keypad_Init(void);
char Keypad_Scan(void);



#endif //RTOS_KEYSCAN_H
